package com.ac.service.impl;

import com.ac.common.ServerResponse;
import com.ac.dao.FolderMapper;
import com.ac.pojo.Folder;
import com.ac.service.IFolderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service("iFolderService")
public class FolderServiceImpl implements IFolderService{

    @Autowired
    private FolderMapper folderMapper;


    /**
     * 根据PID获取子节点目录
     * @param pid
     * @return
     */
    @Override
    public ServerResponse<List<Folder>> getList(String pid){
        List<Folder> list = new ArrayList<Folder>();
        int pidInt = Integer.parseInt(pid);
        list = folderMapper.selectByPid(pidInt);
        return ServerResponse.createBySuccess(list);
    }
}
